<?php
namespace Admin\Controller;
use Think\Controller;
class SignController extends Controller {
    public function index($page=1){
        
        obtain();
        if($page<1){
            $page = 1;
        }
        $day = $page - 1;
        $time =  date("Y-m-d",strtotime("-{$day} day"));
        echo $time;
        $startTime = $time . ' 00:00:00';
        $stopTime = $time . ' 23:59:59';
        $result = M('view_sign_equipmen')->where("ms>'{$startTime}' and ms<'{$stopTime}'")->select();
        $this->assign('list', $result);
        $this->assign('ms',date('Y-m-s H:i:s'));
        //echo $page;
        $this->assign('page', $page);
        $this->display('index');
    }
    public function notSign($page=1){
        
        obtain();
        if($page<1){
            $page = 1;
        }
        $day = $page - 1;
        $time =  date("Y-m-d",strtotime("-{$day} day"));
        $startTime = $time . ' 00:00:00';
        $stopTime = $time . ' 23:59:59';
        $sql = M('sign')->field('equipment')->where("ms>'{$startTime}' and ms<'{$stopTime}'")->group('equipment')->buildSql();
        $result = M('Equipment')->where("equ_id not in {$sql} ")->select();
        $this->assign('list', $result);
        echo $page;
        $this->assign('page', $page);
        $this->display('notSign');
    }
}